package com.luseen.luseenbottomnavigation.BottomNavigation;


import java.util.ArrayList;
import java.util.List;
import ohos.agp.animation.Animator;
import ohos.agp.animation.AnimatorValue;
import ohos.agp.colors.RgbColor;
import ohos.agp.components.*;
import ohos.agp.components.element.Element;
import ohos.agp.components.element.ElementScatter;
import ohos.agp.components.element.ShapeElement;
import ohos.agp.render.Paint;
import ohos.agp.text.Font;
import ohos.agp.utils.Color;
import ohos.app.Context;


public class BottomNavigationView extends DependentLayout
        implements ComponentContainer.ArrangeListener, Component.EstimateSizeListener {

    private OnBottomNavigationItemClickListener onBottomNavigationItemClickListener;

    private Context context;

    static final int NAVIGATION_HEIGHT = 168;

    static final int NAVIGATION_LINE_WIDTH = 1;

    private float textActiveSize;

    private float textInactiveSize;

    private List<BottomNavigationItem> bottomNavigationItems = new ArrayList<>();

    private List<Component> viewList = new ArrayList<>();

    private int itemActiveColorWithoutColoredBackground = -1;

    private int currentItem = 0;

    private int navigationWidth;

    private int shadowHeight;

    private int itemInactiveColor;

    private int itemWidth;

    private int itemHeight;

    private boolean withText;

    private boolean coloredBackground;

    private boolean disableShadow;

    private boolean isTablet;

    private boolean viewPagerSlide;

    private boolean isCustomFont = false;

    private boolean willNotRecreate = true;

    private StackLayout container;

    private Component backgroundColorTemp;

    private PageSlider mViewPager;

    private Font font;

    private boolean chang = true;

    public BottomNavigationView(Context context) {
        super(context);
    }

    public BottomNavigationView(Context context, AttrSet attrSet) {
        super(context, attrSet);
        this.context = context;
        init(attrSet);
        setEstimateSizeListener(this::onEstimateSize);
        setArrangeListener(this::onArrange);
    }

    public BottomNavigationView(Context context, AttrSet attrSet, String styleName) {
        super(context, attrSet, styleName);
        this.context = context;
        init(attrSet);
        setEstimateSizeListener(this::onEstimateSize);
        setArrangeListener(this::onArrange);
    }

    private void init(AttrSet attrs) {
        if (attrs != null) {
            withText = attrs.getAttr("bnv_with_text").isPresent()
                    ? attrs.getAttr("bnv_with_text").get().getBoolValue() : true;
            coloredBackground = attrs.getAttr("bnv_colored_background").isPresent()
                    ? attrs.getAttr("bnv_colored_background").get().getBoolValue() : true;
            disableShadow = attrs.getAttr("bnv_shadow").isPresent()
                    ? attrs.getAttr("bnv_shadow").get().getBoolValue() : false;
            isTablet = attrs.getAttr("bnv_tablet").isPresent()
                    ? attrs.getAttr("bnv_tablet").get().getBoolValue() : false;
            viewPagerSlide = attrs.getAttr("bnv_viewpager_slide").isPresent()
                    ? attrs.getAttr("bnv_viewpager_slide").get().getBoolValue() : true;
            itemActiveColorWithoutColoredBackground = attrs.getAttr("bnv_active_color").isPresent()
                    ? attrs.getAttr("bnv_active_color").get().getIntegerValue() : -1;
            textActiveSize = attrs.getAttr("text_size_active").isPresent()
                    ? attrs.getAttr("text_size_active").get().getIntegerValue() : 14;
            textInactiveSize = attrs.getAttr("inactive_text_size").isPresent()
                    ? attrs.getAttr("inactive_text_size").get().getIntegerValue() : 12;
        }
    }

    @Override
    public boolean onEstimateSize(int i, int i1) {

        navigationWidth = BottomNavigationUtils.getActionbarSize(context);
        LayoutConfig params = new LayoutConfig();

        if (coloredBackground) {
            //白色
            int color = 0xffffffff;
            itemActiveColorWithoutColoredBackground = color;
            itemInactiveColor = color;
            shadowHeight = 13;
        } else {
            if (itemActiveColorWithoutColoredBackground == -1) {
                itemActiveColorWithoutColoredBackground = 0xff2196F3;
            }
            itemInactiveColor = 0xff757575;
            shadowHeight = 8;

        }

        if (isTablet) {
            params.width = navigationWidth + NAVIGATION_LINE_WIDTH;
            params.height = ComponentContainer.LayoutConfig.MATCH_PARENT;
        } else {
            params.width = LayoutConfig.MATCH_PARENT;
            params.height = disableShadow ? NAVIGATION_HEIGHT : NAVIGATION_HEIGHT + shadowHeight;
            if (chang) {
                int height = 13;
                setHeight(height);
                ShapeElement element = new ShapeElement();
                element.setRgbColor(new RgbColor(117, 117, 117));
                setBackground(element);
                setAlpha(0.1f);
            }
        }
        setLayoutConfig(params);
        return false;
    }

    @Override
    public boolean onArrange(int i0, int i1, int i2, int i3) {

        if (container != null) {
            return false;
        }

        if (willNotRecreate) {
            removeAllComponents();
        }

        if (currentItem < 0 || currentItem > (bottomNavigationItems.size() - 1)) {
            throw new IndexOutOfBoundsException(currentItem < 0
                    ? "Position must be 0 or greater than 0, current is " + currentItem
                    : "Position must be less or equivalent than items size, items size is "
                    + (bottomNavigationItems.size() - 1) + " current is " + currentItem);
        }

        if (bottomNavigationItems.size() == 0) {
            throw new NullPointerException("You need at least one item");
        }

        LayoutConfig containerParams;
        LayoutConfig params;
        LayoutConfig lineParams;
        RgbColor white = new RgbColor(255, 255, 255);
        backgroundColorTemp = new Component(context);
        viewList.clear();
        if (isTablet) {
            itemWidth = LayoutConfig.MATCH_PARENT;
            itemHeight = navigationWidth;
        } else {
            itemWidth = getWidth() / bottomNavigationItems.size();
            itemHeight = LayoutConfig.MATCH_PARENT;
        }
        container = new StackLayout(context);
        Component shadow = new Component(context);
        Component line = new Component(context);
        DirectionalLayout items = new DirectionalLayout(context);
        items.setOrientation(isTablet ? DirectionalLayout.VERTICAL : DirectionalLayout.HORIZONTAL);
        LayoutConfig shadowParams = new LayoutConfig(LayoutConfig.MATCH_PARENT, shadowHeight);

        if (isTablet) {
            ShapeElement element = new ShapeElement();
            element.setRgbColor(new RgbColor(76, 175, 80));
            line.setBackground(element);
            containerParams = new LayoutConfig(navigationWidth, LayoutConfig.MATCH_PARENT);
            lineParams = new LayoutConfig(NAVIGATION_LINE_WIDTH, LayoutConfig.MATCH_PARENT);
            params = new LayoutConfig(navigationWidth, LayoutConfig.MATCH_PARENT);
            items.setPadding(0, itemHeight / 2, 0, 0);
            addComponent(line, lineParams);
            if (chang) {
                LayoutConfig backgroundLayoutParams = new LayoutConfig(
                        navigationWidth, LayoutConfig.MATCH_PARENT);
                container.addComponent(backgroundColorTemp, backgroundLayoutParams);
            }
        } else {
            params = new LayoutConfig(LayoutConfig.MATCH_PARENT, NAVIGATION_HEIGHT);
            containerParams = new LayoutConfig(
                    ComponentContainer.LayoutConfig.MATCH_PARENT, NAVIGATION_HEIGHT);
            shadowParams.addRule(LayoutConfig.ABOVE, container.getId());
            ShapeElement element = new ShapeElement();
            element.setRgbColor(new RgbColor(117, 117, 117));
            shadow.setBackground(element);
            shadow.setAlpha(0.1f);

            if (chang) {
                LayoutConfig backgroundLayoutParams = new LayoutConfig(
                        LayoutConfig.MATCH_PARENT, NAVIGATION_HEIGHT);
                backgroundLayoutParams.addRule(LayoutConfig.ALIGN_PARENT_BOTTOM);
                container.addComponent(backgroundColorTemp, backgroundLayoutParams);
            }
        }

        containerParams.addRule(isTablet
                ? LayoutConfig.ALIGN_PARENT_LEFT : LayoutConfig.ALIGN_PARENT_BOTTOM);
        addComponent(shadow, shadowParams);
        addComponent(container, containerParams);
        container.addComponent(items, params);
        LayoutScatter inflater = LayoutScatter.getInstance(context);

        for (int i = 0; i < bottomNavigationItems.size(); i++) {
            final int index = i;

            if (!coloredBackground) {
                bottomNavigationItems.get(i).setColor(white);
            }

            int textActivePaddingTop = 15;
            int viewInactivePaddingTop = 25;
            int viewInactivePaddingTopWithoutText = 48;

            final Component view = inflater.parse(
                    ResourceTable.Layout_bottom_navigation, this, false);
            Image icon = (Image) view.findComponentById(
                    ResourceTable.Id_bottom_navigation_item_icon);
            Text title = (Text) view.findComponentById(
                    ResourceTable.Id_bottom_navigation_item_title);
            if (isCustomFont) {
                title.setFont(font);
            }
            if (isTablet) {
                title.setVisibility(HIDE);
            }

            Color color1 = new Color(itemInactiveColor);
            title.setTextColor(color1);
            viewList.add(view);

            if (bottomNavigationItems.get(i).getImageResourceActive() != 0) {
                if (i == currentItem) {
                    Element iconElement = ElementScatter.getInstance(getContext()).parse(
                            bottomNavigationItems.get(i).getImageResource());
                    icon.setImageElement(iconElement);
                } else {
                    bottomNavigationItems.get(i).getImageResource();
                }
            } else {
                int[] imageBlue = {ResourceTable.Graphic_microphone_blue,
                        ResourceTable.Graphic_love_blue, ResourceTable.Graphic_book_blue,
                        ResourceTable.Graphic_github_blue};
                int[] imageBlack = {ResourceTable.Graphic_microphone_black,
                        ResourceTable.Graphic_love_black, ResourceTable.Graphic_book_black,
                        ResourceTable.Graphic_github_black};
                if (!coloredBackground && i == currentItem) {
                    bottomNavigationItems.get(i).setImageResource(imageBlue[i]);
                    Element iconElement = ElementScatter.getInstance(getContext()).parse(
                            bottomNavigationItems.get(i).getImageResource());
                    icon.setImageElement(iconElement);
                } else if (!coloredBackground && i != currentItem) {
                    bottomNavigationItems.get(i).setImageResource(imageBlack[i]);
                    Element iconElement = ElementScatter.getInstance(getContext()).parse(
                            bottomNavigationItems.get(i).getImageResource());
                    icon.setImageElement(iconElement);
                } else if (coloredBackground) {
                    Element iconElement = ElementScatter.getInstance(getContext()).parse(
                            bottomNavigationItems.get(i).getImageResource());
                    icon.setImageElement(iconElement);
                }
            }
            if (i == currentItem) {
                ShapeElement element = new ShapeElement();
                element.setRgbColor(new RgbColor(bottomNavigationItems.get(index).getColor()));
                container.setBackground(element);
                if (!coloredBackground) {
                    Color color2 = new Color(itemActiveColorWithoutColoredBackground);
                    title.setTextColor(color2);
                }
                icon.setScaleX((float) 1.1);
                icon.setScaleY((float) 1.1);
            }
            if (isTablet) {
                view.setPadding(view.getPaddingLeft(), view.getPaddingTop(), i == currentItem
                                ? textActivePaddingTop : withText
                                ? viewInactivePaddingTop : viewInactivePaddingTopWithoutText,
                        view.getPaddingBottom());
            } else {
                view.setPadding(view.getPaddingLeft(), i == currentItem
                                ? textActivePaddingTop : withText
                                ? viewInactivePaddingTop : viewInactivePaddingTopWithoutText,
                        view.getPaddingRight(), view.getPaddingBottom());
            }
            int text_size = (int) (i == currentItem ? textActiveSize : withText
                    ? textInactiveSize : 0);
            title.setTextSize(text_size, Text.TextSizeType.FP);
            title.setText(bottomNavigationItems.get(i).getTitle());

            LayoutConfig itemParams = new LayoutConfig(itemWidth, itemHeight);
            items.addComponent(view, itemParams);

            view.setClickedListener(new ClickedListener() {
                @Override
                public void onClick(Component component) {
                    try {
                        onBottomNavigationItemClick(index);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            });
        }
        return false;
    }

    private void onBottomNavigationItemClick(final int itemIndex) {
        if (currentItem == itemIndex) {
            return;
        }

        int viewActivePaddingTop = 15;
        int viewInactivePaddingTop = 25;
        int viewInactivePaddingTopWithoutText = 48;
        int centerX;
        int centerY;
        for (int i = 0; i < viewList.size(); i++) {
            int[] imageBlue = {ResourceTable.Graphic_microphone_blue,
                    ResourceTable.Graphic_love_blue,
                    ResourceTable.Graphic_book_blue, ResourceTable.Graphic_github_blue};
            int[] imageBlack = {ResourceTable.Graphic_microphone_black,
                    ResourceTable.Graphic_love_black,
                    ResourceTable.Graphic_book_black, ResourceTable.Graphic_github_black};

            if (i == itemIndex) {
                Component view = viewList.get(itemIndex).findComponentById(
                        ResourceTable.Id_bottom_navigation_container);
                final Text title = (Text) view.findComponentById(
                        ResourceTable.Id_bottom_navigation_item_title);
                final Image icon = (Image) view.findComponentById(
                        ResourceTable.Id_bottom_navigation_item_icon);

                changeTextColor(title, itemInactiveColor, itemActiveColorWithoutColoredBackground);
                BottomNavigationUtils.changeTextSize(title, withText
                        ? textInactiveSize : 0, textActiveSize);

                if (bottomNavigationItems.get(i).getImageResourceActive() != 0) {
                    Element iconElement = ElementScatter.getInstance(getContext()).parse(
                            bottomNavigationItems.get(i).getImageResource());
                    icon.setImageElement(iconElement);
                } else {
                    if (!coloredBackground) {
                        bottomNavigationItems.get(i).setImageResource(imageBlue[i]);
                        Element iconElement = ElementScatter.getInstance(getContext()).parse(
                                bottomNavigationItems.get(i).getImageResource());
                        icon.setImageElement(iconElement);
                        title.setTextColor(new Color(itemActiveColorWithoutColoredBackground));
                        title.setText(bottomNavigationItems.get(i).getTitle());
                    }
                    BottomNavigationUtils.changeImageColorFilter(icon, itemInactiveColor,
                            bottomNavigationItems.get(itemIndex).getColor());
                }
                title.setVisibility(VISIBLE);

                icon.createAnimatorProperty()
                        .setDuration(500)
                        .scaleX((float) 1.1)
                        .scaleY((float) 1.1)
                        .start();

                view.setPadding(view.getPaddingLeft(), viewActivePaddingTop, view.getPaddingRight(),
                        view.getPaddingBottom());

                if (isTablet) {
                    centerX = viewList.get(itemIndex).getWidth() / 2;
                    centerY = viewList.get(itemIndex).getBottom()
                            + viewList.get(itemIndex).getHeight() / 2;
                } else {
                    centerX = (int) viewList.get(itemIndex).getContentPositionX()
                            + viewList.get(itemIndex).getWidth() / 2;
                    centerY = viewList.get(itemIndex).getHeight() / 2;
                }
                int aCenterX = centerX;
                int aCenterY = centerY;
                int finalRadius = Math.max(getWidth(), getHeight());

                if (chang) {
                    AnimatorValue animatorValue = new AnimatorValue();
                    animatorValue.setCurveType(
                            Animator.CurveType.CUBIC_BEZIER_EXTREME_DECELERATION);
                    animatorValue.setDuration(500);
                    animatorValue.setValueUpdateListener((a, v) -> {
                        changeBackgroundColorTemp(aCenterX, aCenterY, (int) (finalRadius * v),
                                new Color(
                                        bottomNavigationItems.get(itemIndex).getColor().asArgbInt()));
                        if (v == 1) {
                            ShapeElement element = new ShapeElement();
                            element.setRgbColor(bottomNavigationItems.get(itemIndex).getColor());
                            backgroundColorTemp.setBackground(element);
                        }
                    });
                    animatorValue.start();

                } else {
                    BottomNavigationUtils.changeViewBackgroundColor(
                            container, bottomNavigationItems.get(currentItem).getColor(),
                            bottomNavigationItems.get(itemIndex).getColor());
                }
            } else if (i == currentItem) {
                Component view = viewList.get(i).findComponentById(
                        ResourceTable.Id_bottom_navigation_container);
                final Text title = (Text) view.findComponentById(
                        ResourceTable.Id_bottom_navigation_item_title);
                final Image icon = (Image) view.findComponentById(
                        ResourceTable.Id_bottom_navigation_item_icon);
                if (bottomNavigationItems.get(i).getImageResourceActive() != 0) {
                    Element iconElement = ElementScatter.getInstance(getContext()).parse(
                            bottomNavigationItems.get(i).getImageResource());
                    icon.setImageElement(iconElement);
                } else {
                    if (!coloredBackground) {
                        bottomNavigationItems.get(i).setImageResource(imageBlack[i]);
                        Element iconElement = ElementScatter.getInstance(getContext()).parse(
                                bottomNavigationItems.get(i).getImageResource());
                        icon.setImageElement(iconElement);
                    }
                    BottomNavigationUtils.changeImageColorFilter(icon,
                            itemActiveColorWithoutColoredBackground,
                            bottomNavigationItems.get(itemIndex).getColor());
                }

                changeTextColor(title, itemActiveColorWithoutColoredBackground, itemInactiveColor);
                BottomNavigationUtils.changeTextSize(title,
                        textActiveSize, withText ? textInactiveSize : 0);
                if (isTablet) {
                    BottomNavigationUtils.changeRightPadding(view, viewActivePaddingTop, withText
                            ? viewInactivePaddingTop : viewInactivePaddingTopWithoutText);
                } else {
                    BottomNavigationUtils.changeViewTopPadding(view, viewActivePaddingTop, withText
                            ? viewInactivePaddingTop : viewInactivePaddingTopWithoutText);
                }
                if (!withText) {
                    title.setVisibility(HIDE);
                }

                icon.createAnimatorProperty()
                        .setDuration(500)
                        .scaleX((float) 0.9)
                        .scaleY((float) 0.9)
                        .start();
            } else if (i != itemIndex && i != currentItem) {
                Component view = viewList.get(i).findComponentById(
                        ResourceTable.Id_bottom_navigation_container);
                final Text title = (Text) view.findComponentById(
                        ResourceTable.Id_bottom_navigation_item_title);
                final Image icon = (Image) view.findComponentById(
                        ResourceTable.Id_bottom_navigation_item_icon);
                if (bottomNavigationItems.get(i).getImageResourceActive() != 0) {
                    Element iconElement = ElementScatter.getInstance(getContext()).parse(
                            bottomNavigationItems.get(i).getImageResource());
                    icon.setImageElement(iconElement);
                } else {
                    if (!coloredBackground) {
                        bottomNavigationItems.get(i).setImageResource(imageBlack[i]);
                        Element iconElement = ElementScatter.getInstance(getContext()).parse(
                                bottomNavigationItems.get(i).getImageResource());
                        icon.setImageElement(iconElement);
                    }
                    BottomNavigationUtils.changeImageColorFilter(icon,
                            itemActiveColorWithoutColoredBackground,
                            bottomNavigationItems.get(itemIndex).getColor());
                }
                changeTextColor(title, itemActiveColorWithoutColoredBackground, itemInactiveColor);
                BottomNavigationUtils.changeTextSize(title, textActiveSize, withText
                        ? textInactiveSize : 0);
                if (!withText) {
                    title.setVisibility(HIDE);
                }
            }
        }

        if (mViewPager != null) {
            mViewPager.setCurrentPage(itemIndex, viewPagerSlide);
        }

        if (onBottomNavigationItemClickListener != null) {
            onBottomNavigationItemClickListener.onNavigationItemClick(itemIndex);
        }
        currentItem = itemIndex;
    }

    void changeTextColor(final Text textView, int fromColor, int toColor) {
        AnimatorValue changeTextColorAnimation = new AnimatorValue();
        changeTextColorAnimation.setDuration(150);
        changeTextColorAnimation.setValueUpdateListener(new AnimatorValue.ValueUpdateListener() {
            @Override
            public void onUpdate(AnimatorValue animatorValue, float v) {
                if (!coloredBackground) {
                    textView.setTextColor(new Color(toColor));
                } else {
                    textView.setTextColor(new Color(toColor));
                }
            }
        });
        changeTextColorAnimation.start();
    }

    private void changeBackgroundColorTemp(int x, int y, int radius, Color color) {
        DrawTask drawTask = (component, canvas) -> {
            Paint paint = new Paint();
            paint.setStyle(Paint.Style.FILL_STYLE);
            paint.setColor(color);
            canvas.drawCircle(x, y, radius, paint);
        };
        backgroundColorTemp.addDrawTask(drawTask);
    }

    /**
     * Creates a connection between this navigation view and a ViewPager
     *
     * @param pager          pager to connect to
     * @param colorResources color resources for every item in the ViewPager adapter
     * @param imageResources images resources for every item in the ViewPager adapter
     */

    public void setUpWithViewPager(PageSlider pager, RgbColor[] colorResources,
                                   int[] imageResources) {
        this.mViewPager = pager;
        if (pager.getProvider().getCount() != colorResources.length
                || pager.getProvider().getCount() != imageResources.length) {
            throw new IllegalArgumentException(
                    "colorResources and imageResources must be equal to the ViewPager items : "
                            + pager.getProvider().getCount());
        }
        for (int i = 0; i < pager.getProvider().getCount(); i++) {
            addTab(new BottomNavigationItem(
                    pager.getProvider().getPageTitle(i).toString(),
                    colorResources[i], imageResources[i]));
        }
    }

    /**
     * Add item for BottomNavigation
     *
     * @param item item to add
     */
    public void addTab(BottomNavigationItem item) {
        bottomNavigationItems.add(item);
        container = null;
    }

    /**
     * Activate BottomNavigation tablet mode
     */
    public void activateTabletMode() {
        isTablet = true;
    }

    /**
     * Change text visibility
     *
     * @param withText disable or enable item text
     */
    public void isWithText(boolean withText) {
        this.withText = withText;
    }


    /**
     * Item Active Color if isColoredBackground(false)
     *
     * @param itemActiveColorWithoutColoredBackground act ive item color
     */
    public void setItemActiveColorWithoutColoredBackground(
            int itemActiveColorWithoutColoredBackground) {
        this.itemActiveColorWithoutColoredBackground = itemActiveColorWithoutColoredBackground;
    }

    /**
     * With this BottomNavigation background will be white
     *
     * @param coloredBackground disable or enable background color
     */
    public void isColoredBackground(boolean coloredBackground) {
        this.coloredBackground = coloredBackground;
    }

    /**
     * Change tab programmatically
     *
     * @param position selected tab position
     */
    public void selectTab(int position) {
        onBottomNavigationItemClick(position);
        currentItem = position;
    }

    /**
     * Disable shadow of BottomNavigationView
     */
    public void disableShadow() {
        disableShadow = true;
    }

    /**
     * Disable slide animation when using ViewPager
     */
    public void disableViewPagerSlide() {
        viewPagerSlide = false;
    }

    /**
     * Change Active text size
     *
     * @param textActiveSize size
     */
    public void setTextActiveSize(float textActiveSize) {
        this.textActiveSize = textActiveSize;
    }

    /**
     * Change Inactive text size
     *
     * @param textInactiveSize size
     */
    public void setTextInactiveSize(float textInactiveSize) {
        this.textInactiveSize = textInactiveSize;
    }

    /**
     * Setup interface for item onClick
     */
    public void setOnBottomNavigationItemClickListener(
            OnBottomNavigationItemClickListener onBottomNavigationItemClickListener) {
        this.onBottomNavigationItemClickListener = onBottomNavigationItemClickListener;
    }

    /**
     * Returns the item that is currently selected
     *
     * @return Currently selected item
     */
    public int getCurrentItem() {
        return currentItem;
    }

    /**
     * If your activity/fragment will not recreate
     * you can call this method
     *
     * @param willNotRecreate set true if will not recreate
     */
    public void willNotRecreate(boolean willNotRecreate) {
        this.willNotRecreate = willNotRecreate;
    }

    /**
     * set custom font for item texts
     *
     * @param font custom font
     */
    public void setFont(Font font) {
        isCustomFont = true;
        this.font = font;
    }

    /**
     * get item text size on active status
     *
     * @return font size
     */
    public float getTextActiveSize() {
        return textActiveSize;
    }

    /**
     * get item text size on inactive status
     *
     * @return font size
     */
    public float getTextInactiveSize() {
        return textInactiveSize;
    }

    public BottomNavigationItem getItem(int position) {
        onBottomNavigationItemClick(position);
        return bottomNavigationItems.get(position);
    }
}


